<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>${message("shop.member.order.view")}[#if systemShowPowered] - 【妖精猫】情趣商城[/#if]</title>
<meta name="author" content="frankie" />

<link href="${base}/resources/shop/css/common.css" rel="stylesheet" type="text/css" />
<link href="${base}/resources/shop/css/member.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${base}/resources/shop/js/jquery.js"></script>
<script type="text/javascript" src="${base}/resources/shop/js/common.js"></script>
<script type="text/javascript">
$().ready(function() {

	[@flash_message /]
	
});
</script>
</head>
<body>
	<div id="dialogOverlay" class="dialogOverlay"></div>
	[#assign current = "orderList" /]
	[#include "/shop/include/header.ftl" /]
	<div class="container member">
		[#include "/shop/member/include/navigation.ftl" /]
		<div class="span18 last">
			<div class="input order">
				<div class="title">查看任务</div>
				<div class="top">
					<span>任务编号: ${task.id}</span>
					<span>
						任务状态：
						<strong>
							[#if order.expired]
								${message("shop.member.order.hasExpired")}
							[#elseif order.orderStatus == "completed" || order.orderStatus == "cancelled"]
								${message("Order.OrderStatus." + order.orderStatus)}
							[#elseif order.paymentStatus == "unpaid" || order.paymentStatus == "partialPayment"]
								${message("shop.member.order.waitingPayment")}
								[#if order.shippingStatus != "unshipped"]
									${message("Order.ShippingStatus." + order.shippingStatus)}
								[/#if]
							[#else]
								${message("Order.PaymentStatus." + order.paymentStatus)}
								[#if order.paymentStatus == "paid" && order.shippingStatus == "unshipped"]
									${message("shop.member.order.waitingShipping")}
								[#else]
									${message("Order.ShippingStatus." + order.shippingStatus)}
								[/#if]
							[/#if]
						</strong>
					</span>
					<span class="handle">
						[#if !order.expired && (order.orderStatus == "unconfirmed" || order.orderStatus == "confirmed") && (order.paymentStatus == "unpaid" || order.paymentStatus == "partialPayment")]
							<a href="payment.jhtml?sn=${order.sn}" class="button">${message("shop.member.order.payment")}</a>
						[/#if]
						[#if !order.expired && order.orderStatus == "unconfirmed" && order.paymentStatus == "unpaid"]
							<a href="javascript:;" id="cancel" class="button">${message("shop.member.order.cancel")}</a>
						[/#if]
					</span>
				</div>
				<table class="info">
					<tr>
						<th>
							${message("shop.common.createDate")}:
						</th>
						<td>
							${order.createDate?string("yyyy-MM-dd HH:mm:ss")}
						</td>
					</tr>
					<tr>
						<th>
							${message("Order.paymentMethod")}:
						</th>
						<td>
							${order.paymentMethodName}
						</td>
					</tr>
					<tr>
						<th>
							${message("Order.shippingMethod")}:
						</th>
						<td>
							${order.shippingMethodName}
						</td>
					</tr>
					[#if order.point > 0]
						<tr>
							<th>
								${message("Order.point")}:
							</th>
							<td>
								${order.point}
							</td>
						</tr>
					[/#if]
					<tr>
						<th>
							${message("Order.price")}:
						</th>
						<td>
							${currency(order.price, true)}
						</td>
					</tr>
					[#if order.fee > 0]
						<tr>
							<th>
								${message("Order.fee")}:
							</th>
							<td>
								${currency(order.fee, true)}
							</td>
						</tr>
					[/#if]
					[#if order.freight > 0]
						<tr>
							<th>
								${message("Order.freight")}:
							</th>
							<td>
								${currency(order.freight, true)}
							</td>
						</tr>
					[/#if]
					[#if order.promotionDiscount > 0]
						<tr>
							<th>
								${message("Order.promotionDiscount")}:
							</th>
							<td>
								${currency(order.promotionDiscount, true)}
							</td>
						</tr>
					[/#if]
					[#if order.couponDiscount > 0]
						<tr>
							<th>
								${message("Order.couponDiscount")}:
							</th>
							<td>
								${currency(order.couponDiscount, true)}
							</td>
						</tr>
					[/#if]
					<tr>
						<th>
							${message("Order.amount")}:
						</th>
						<td>
							${currency(order.amount, true)}
						</td>
					</tr>
					[#if order.couponCode??]
						<tr>
							<th>
								${message("shop.member.order.coupon")}:
							</th>
							<td>
								${order.couponCode.coupon.name}
							</td>
						</tr>
					[/#if]
					[#if order.promotion??]
						<tr>
							<th>
								${message("Order.promotion")}:
							</th>
							<td>
								${order.promotion}
							</td>
						</tr>
					[/#if]
					<tr>
						<th>
							${message("Order.memo")}:
						</th>
						<td>
							${order.memo}
						</td>
					</tr>
				</table>
				<table class="orderItem">
					<tr>
						<th>
							${message("OrderItem.sn")}
						</th>
						<th>
							${message("OrderItem.name")}
						</th>
						<th>
							${message("OrderItem.price")}
						</th>
						<th>
							${message("OrderItem.quantity")}
						</th>
						<th>
							${message("OrderItem.subtotal")}
						</th>
					</tr>
					[#list order.orderItems as orderItem]
						<tr>
							<td>
								${orderItem.sn}
							</td>
							<td>
								[#if orderItem.product??]
									<a href="${base}${orderItem.product.path}" title="${orderItem.fullName}" target="_blank">${abbreviate(orderItem.fullName, 30)}</a>
								[#else]
									<span title="${orderItem.fullName}">${abbreviate(orderItem.fullName, 30)}</span>
								[/#if]
								[#if orderItem.isGift]
									<span class="red">[${message("shop.member.order.gift")}]</span>
								[/#if]
							</td>
							<td>
								[#if !orderItem.isGift]
									${currency(orderItem.price, true)}
								[#else]
									-
								[/#if]
							</td>
							<td>
								${orderItem.quantity}
							</td>
							<td>
								[#if !orderItem.isGift]
									${currency(orderItem.subtotal, true)}
								[#else]
									-
								[/#if]
							</td>
						</tr>
					[/#list]
				</table>
			</div>
		</div>
	</div>
	[#include "/shop/include/footer.ftl" /]
</body>
</html>